home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_roomamb.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  104 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHW_RoomAmb.cog
  4. #
  5. # Produces random ambient cave sounds when attatched to a ghost object.
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC]  modified 12/3 by [CMG]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     crossed
  16.     message     pulse
  17.     
  18.     surface       oncross               linkID=2
  19.     surface       oncross1              linkID=2
  20.     surface       oncross2              linkID=2
  21.     surface       oncross3              linkID=2
  22.     
  23.     
  24.     surface       offcross              linkID=3
  25.     surface       offcross1             linkID=3
  26.     surface       offcross2             linkID=3
  27.     surface       offcross3             linkID=3
  28.     
  29.             
  30.     sound       sndCave0=shw_amb1.wav    local
  31.     sound       sndCave1=teo_gen_a1.wav    local
  32.     sound       sndCave2=teo_gen_a4.wav    local
  33.     sound       sndCave3=teo_gen_a6.wav    local
  34.     sound       sndCave4=nub_ambient2_a.wav    local
  35.     sound       sndCave5=nub_ambient3_a.wav    local
  36.         
  37.     float       caveFreq        local
  38.     
  39.     flex        pulseTime=4.0
  40.     flex        vol=1.0
  41.     
  42. end
  43.  
  44. # ========================================================================================
  45.  
  46. code
  47.  
  48. crossed:
  49.  
  50.     If (GetSenderID() == 2)
  51.             {
  52.             SetPulse(pulseTime);
  53.             print("starting sound");
  54.             }
  55.     
  56.     If (GetSenderID() == 3)
  57.             {
  58.             SetPulse(0);
  59.             print("shutting off sound");
  60.             }
  61.  
  62. return;
  63. # ========================================================================================
  64.  
  65. pulse:
  66.     
  67.     caveFreq = Rand();
  68.  
  69.     if (caveFreq < 0.16)
  70.         {
  71.             PlaySoundLocal(sndCave0, vol, 1, 0, 0);
  72.         }
  73.         
  74.     if ((caveFreq > 0.16) && (caveFreq < 0.32))
  75.         {
  76.             PlaySoundLocal(sndCave1, vol, 1, 0, 0);
  77.         }
  78.         
  79.     if ((caveFreq > 0.32) && (caveFreq < 0.48))
  80.         {
  81.             PlaySoundLocal(sndCave2, vol, -1, 0, 0);
  82.         }
  83.     
  84.     if ((caveFreq > 0.48) && (caveFreq < 0.64))
  85.         {
  86.             PlaySoundLocal(sndCave3, vol, 1, 0, 0);
  87.         }
  88.     
  89.     if ((caveFreq > 0.64) && (caveFreq < 0.80))
  90.         {
  91.             PlaySoundLocal(sndCave4, vol, 0, 0, 0);
  92.         }
  93.     
  94.     if ((caveFreq > 0.80) && (caveFreq < 0.96))
  95.         {
  96.             PlaySoundLocal(sndCave5, vol, -1, 0, 0);
  97.         }
  98.         
  99.     return;
  100.     
  101. # ========================================================================================
  102.         
  103. end
  104.